#include <iostream>
#include <vector>
#include <queue>
using namespace std;

int main()
{
	int n, m;
	cin >> n >> m;
	vector<vector<int>> gh(n + 1);
	vector<int> indgree(n + 1, 0);
	vector<int> prize(n + 1, 100);

	for (int i = 0; i < m; i++) {
		int u, v;
		cin >> v >> u;
		gh[u].push_back(v);
		indgree[v]++;
	}

	queue<int> q;
	for (int i = 1; i <= n; i++) {
		if (indgree[i] == 0) {
			q.push(i);
		}
	}

	int ans = 0;
	int cnt = 0;
	while (!q.empty()) {
		int u = q.front();
		q.pop();
		ans += prize[u];
		cnt++;

		for (auto v : gh[u]) {
			prize[v] = max(prize[v], prize[u] + 1);
			if (--indgree[v] == 0) {
				q.push(v);
			}
		}
	}
	if (cnt != n) {
		cout << "Poor Xed" << endl;
	} else {
		cout << ans << endl;
	}
	return 0;
}